#! /bin/bash

if [ $# -ne 2 ]; ## backspace
then
    echo "Usage: $0  turns-number  save-to-file"
else
    # truncate file
    echo "Truncates file: [$2]"
    echo -n "" > $2

    # generate random numbers
    echo "Generating random numbers and save to [$2]"
    for j in 1 2 3;
    do
        for i in $(seq 1 $1);
        do
            echo -n "$RANDOM " >> $2
        done
        echo >> $2
    done
    echo done
fi
